local sz_fushui = fk.CreateSkill {
    name = "sz_fushui",
    dynamic_desc = function(self, player)
        if player:getMark("benghui_juexing") ~= 0 then
            return "sz_fushui1"
        end
    end,
}

Fk:loadTranslationTable {
    ["sz_fushui"] = "符水",
    [":sz_fushui"] = "出牌阶段限每名角色限一次，你可以将一张“符”交给一名受伤的其他角色，令其回复一点体力。",
    [":sz_fushui1"] = "出牌阶段限，你可以将一张“符”交给一名其他角色，令其失去一点体力。",
    ["#sz_fushui"] = "符水：你可以交出一张“符”，令目标回复体力。",
    ["#sz_fushui_ex"] = "符水：你可以交出一张“符”，令目标失去体力。",

    ["$sz_fushui1"] = "",
    ["$sz_fushui2"] = "",

}

sz_fushui:addEffect('active', {
    anim_type = "offensive",
    prompt = function(self, player)
        if player:getMark("benghui_juexing") == 0 then
            return "#sz_fushui"
        else
            return "#sz_fushui_ex"
        end
    end,
    min_card_num = 1,
    max_card_num = 1,
    target_num = 1,
    can_use = function(self, player)
        if player:getMark("benghui_juexing") == 0 then
            return #table.filter(player:getCardIds("h"), function(i)
                    return Fk:getCardById(i):getMark("@@sz_anji-inhand") > 0
                end) > 0 and
                #table.filter(Fk:currentRoom().alive_players, function(p) return p ~= player and p:isWounded() end) > 0
        else
            return #table.filter(player:getCardIds("h"), function(i)
                return Fk:getCardById(i):getMark("@@sz_anji-inhand") > 0
            end) > 0
        end
    end,
    card_filter = function(self, player, to_select, selected)
        return #selected == 0 and Fk:getCardById(to_select):getMark("@@sz_anji-inhand") > 0
    end,
    target_filter = function(self, player, to_select, selected, selected_cards)
        if player:getMark("benghui_juexing") == 0 then
            return #selected == 0 and to_select ~= player and to_select:isWounded() and
                to_select:getMark("fushui-turn") == 0
        else
            return #selected == 0 and to_select ~= player and
                to_select:getMark("fushui-turn") == 0
        end
    end,
    on_use = function(self, room, effect)
        local player = effect.from
        local mark = player:getTableMark("fushui_name")
        local target = effect.tos[1]
        local card = effect.cards[1]
        room:obtainCard(target, card, true, fk.ReasonGive, player, sz_fushui.name)
        room:addTableMarkIfNeed(player, "fushui_name", target.id)
        if player:getMark("benghui_juexing") == 0 then
            if not target.dead then
                room:recover({
                    who = target,
                    num = 1,
                    recoverBy = player,
                    skillName = sz_fushui.name,
                })
            end
        else
            room:loseHp(target, 1, sz_fushui.name)
        end
    end,
})
return sz_fushui
